package com.pd.backend.dtos;

import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.AllArgsConstructor;
import lombok.Data;
import lombok.NoArgsConstructor;

/**
 *  快递作业请求类
 */
@Data
@AllArgsConstructor
@NoArgsConstructor
@ApiModel(value = "快递作业请求类")
public class TaskPickupDto {
    /**
     * 任务类型
     */
    @ApiModelProperty(value = "任务类型:1为取件,2为派件")
    private Integer taskType;
    /**
     * 页面大小
     */
    @ApiModelProperty(value = "页面大小")
    protected Integer size;
    /**
     * 当前页数
     */
    @ApiModelProperty(value = "当前页数")
    protected Integer page;
    /**
     * 运单编号
     */
    @ApiModelProperty(value = "运单编号")
    private String orderId;

    /**
     * 收或发件人姓名
     */
    @ApiModelProperty(value = "收或发件人姓名")
    private String name;
    /**
     * 快递员姓名
     */
    @ApiModelProperty(value = "快递员姓名")
    private String courierName;
    /**
     * 作业状态
     */
    @ApiModelProperty(value = "作业状态")
    private Integer status;
    /**
     * 省份id
     */
    @ApiModelProperty(value = "省份id")
    private String provinceId;
    /**
     * 城市id
     */
    @ApiModelProperty(value = "城市id")
    private String cityId;
    /**
     * 区县id
     */
    @ApiModelProperty(value = "区县id")
    private String countyId;

    public void checkParam() {
        if (this.page == null || this.page < 0) {
            setPage(1);
        }
        if (this.size == null || this.size < 0 || this.size > 100) {
            setSize(10);
        }
    }

}